package com.liangtian.mdm.dm.sql.enums;

/**
 * 默认列
 *
 * @author honye
 */
public enum Column {

    ID("ID", "主键", "", 20, false, 1),
    PID("PID", "父ID", "", 20, true, 100),
    MAINID("MAINID", "主表ID", "", 20, true, 105), //从表中主表的id


    STATE("STATE", "流程状态", "", 10, true, 110),
    STATUS("STATUS", "数据状态", "", 10, true, 120),
    VERSION("VERSION", "数据版本", "", 10, true, 130),
    DISFLAG("DIS_FLAG", "分发标识", "", 10, true, 200), //对变更表属于冗余字段(以便使用统一查询)、  opertype变更表独有字段
    ERRORTEXT("ERROR_TEXT", "校验错误提示", "", 500, true, 220),//错误提示

    CREATEID("CREATER_ID", "创建人ID", "", 10, true, 140),
    CREATENAME("CREATER_NAME", "创建人姓名", "", 20, true, 150),
    CREATETIME("CREATER_TIME", "创建时间", "DATETIME", 20, true, 160),

    UPDATEID("UPDATER_ID", "更新人ID", "", 10, true, 170),
    UPDATENAME("UPDATER_NAME", "更新人姓名", "", 20, true, 180),
    UPDATETIME("UPDATER_TIME", "更新时间", "DATETIME", 20, true, 190);

    private String name;
    private String desc;
    private String type;
    private int length;
    private boolean isNull;
    private int order;

    private Column(String name, String desc, String type, int length, boolean isNull, int order) {
        this.name = name;
        this.desc = desc;
        this.type = type;
        this.length = length;
        this.isNull = isNull;
        this.order = order;
    }

    private Column(String name, String desc, String type) {
        this.name = name;
        this.desc = desc;
        this.type = type;
        this.length = 20;
        this.isNull = true;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    public String getType() {
        return type;
    }

    public int getLength() {
        return length;
    }

    public boolean isNull() {
        return isNull;
    }

    public int getOrder() {
        return order;
    }

    @Override
    public String toString() {
        return "Column[name=" + this.getName() + ", desc=" + this.getDesc() + ", type=" + this.getType()
                + ", length=" + this.getLength() + ", isNull=" + this.isNull + ", order=" + this.getOrder() + "]";
    }

}
